#include "includes.h"

#ifdef USE_KB
#define USE_KB_SHIFT

void KbInit(uint8_t ch)
{
#ifdef USE_KB_SHIFT
	PSFT1 |= BIT3;				//Shift KB
#endif	//USE_KB_SHIFT
	KBCON = ch;
#ifdef USE_KB_ISR
	IRCON &= ~BIT4;
	EKB = 1;							//Enable KB interrupt
#endif	//USE_KB_ISR
}

#ifdef USE_KB_DEMO
void KbDemoInit(void)
{
	LedInit();
	P2M0 &= ~(0x3F);
	P2M1 |= 0x3F;
	DelayMs(100);
	KbInit(0x3F);
	EA = 1;
}

void KbDemoProc(void)
{
	
}

void KbDemoIsrProc(void)
{
	LED0 = ~LED0;
}
#endif	//USE_KB_DEMO



#endif	//USE_KB
